@extends('admin.layout')
@section('content')
	<div class="content-wrapper" style="min-height: 946px;">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                管理员管理
                <small>编辑</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">管理员管理</a></li>
                <li class="active">编辑</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速编辑</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/admin/update') }}/{{ $data -> id }}" method="post" enctype="multipart/form-data">
                        	{{ csrf_field() }}

                            @if(session('info'))
                            <div class="callout callout-success">
                                <p>{{session('info')}}</p>
                            </div>
                            @endif
                        	@if($errors -> any())
                        	<div class="alert alert-danger alert-dismissable">
			                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
			                    <h4><i class="icon fa fa-ban"></i> Alert!</h4>
									@foreach($errors -> all() as $error)
										<p>{{ $error }}</p>
									@endforeach
			                </div>
                            @endif 
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">管理员名：</label>
                                    <input class="form-control" id="exampleInputEmail1" placeholder="请输入用户名" type="text" name="name" value="@if(old('name')){{ old('name') }}@else{{$data -> name}}@endif" style="width:400px;">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">密码：</label>
                                    <input class="form-control" id="exampleInputPassword1" placeholder="请输入密码" type="password" name="password" style="width:400px;">  
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">确认密码：</label>
                                    <input class="form-control" id="exampleInputPassword1" placeholder="请确认密码" type="password" name="repassword" style="width:400px;">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">邮箱：</label>
                                    <input name="email" class="form-control" id="exampleInputPassword1" placeholder="请输入邮箱" type="text" value="@if(old('email')){{ old('email') }}@else{{$data -> email}}@endif" style="width:400px;">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputFile">个人头像</label>
                                    <img 
                                    @if($data -> pic == 'default.jpg')
                                    src="/uploads/{{ $data -> pic }}" 
                                    @else
                                    src="/uploads/imgs/{{ $data -> pic }}" 
                                    @endif
                                    width="200" />
                                    <input id="exampleInputFile" type="file" name="pic" value="{{ old('pic') }}" style="width:400px;">
                                    <p class="help-block">请选择头像</p>
                                </div>
                                <select name='auth' class="form-control">
                                        <option value="8">普通管理员</option>
                                       
                                        <option value="9">超级管理员</option>
                                </select>
                               
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">更新</button>
                            </div>
                        </form>
                    </div><!-- /.box -->

               
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div>
@endsection